package com.atguigu.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atguigu.entity.Dict;
import com.atguigu.result.Result;
import com.atguigu.service.DictService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("dict")
public class DictController {
    @Reference
    private DictService dictService;

    @RequestMapping ("findListByDictCode/{dictCode}")
    public Result findListByDictCode(@PathVariable String dictCode){
        List<Dict> areaList123 = dictService.findListByDictCode(dictCode);
        return Result.ok(areaList123);
    }

    @RequestMapping("findListByParentId/{id}")
    public Result findListByParentId(@PathVariable Long id){
        List<Dict> plateList = dictService.findListByParentId(id);
        return Result.ok(plateList);
    }



}
